import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Timer;
import java.util.TimerTask;
 
 
 
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
 
 
@SuppressWarnings("serial")
public class Stoppuhr extends JFrame {
 
    static Stoppuhr su = new Stoppuhr();
    
    public static void main(String[] args) {
          
    }

    
    static JLabel lblzeit;
    
    private void initWindow() {
    
        
        lblzeit = new JLabel("00:00:00");
        JButton btnstart = new JButton("Start");
        JButton btnstopp = new JButton("Stop");
        
        btnstart.addActionListener(new ActionListener() {   
              public void actionPerformed(ActionEvent arg0) {   
                 
                  final Timer timer = new Timer();
                  final Zeit z = new Zeit();
                  z.setEin(0);
                  final TimerTask task = new TimerTask() {
                      public void run() {
                      if (Zeit.aus == 1) timer.cancel();
                      else z.macheZeit();
                      }
                      
                      };
                      timer.scheduleAtFixedRate(task, 0, 1000);
              }
        });
        
        btnstopp.addActionListener(new ActionListener() {   
              public void actionPerformed(ActionEvent arg0) {   
                  Zeit z = new Zeit();
                  z.setAus(1);
              }
        });
        
    } 
 
}